<template>
    <div class="app-container">

      <div slot="table">
        <el-table border   v-loading="loading" :data="pInformationList"  >
        <el-table-column type="selection" width="55" align="center" />
        <el-table-column label="序号" align="center" prop="id" />
        <el-table-column  v-if="this.$store.state.user.name == 'admin'" label="用户名" align="center" prop="createUsername" />
        <el-table-column label="选手姓名" align="center" prop="name" >
          <template slot-scope="scope">
            <span style="color: blue">{{scope.row.name}}</span>
          </template>
        </el-table-column>
        <el-table-column label="个人证件照" align="center" prop="imageName" width="150px" >
          <template slot-scope="scope">
            <image-preview :src="scope.row.imageName" :width="100" :height="100"/>
          </template>
           </el-table-column>
        <el-table-column label="性别" align="center" prop="sex">
          <template slot-scope="scope">
            <dict-tag :options="dict.type.sys_user_sex" :value="scope.row.sex"/>
          </template>
        </el-table-column>
        <el-table-column label="年龄" align="center" prop="age" />
        <el-table-column label="国籍" align="center" prop="nationality" width="100px"/>
        <el-table-column label="联系方式" align="center" prop="contcatWay" width="180px" />
        <el-table-column label="邮箱" align="center" prop="mailbox" width="180px"/>
<!--        <el-table-column label="参与赛事" align="center" prop="participateEvent">-->
<!--          <template slot-scope="scope">-->
<!--            <dict-tag :options="dict.type.sys_job_group" :value="scope.row.participateEvent"/>-->
<!--          </template>-->
<!--        </el-table-column>-->
        <el-table-column
            label="身体状况" align="center" prop="physicalCondition"
            :filters="[{ text: '正常', value: '1' }, { text: '良好', value: '2' },{text:'异常',value:'3'}]"
            :filter-method="filterTag1"
            width="120px">
            <template slot-scope="scope">
              <el-tag
                :type="scope.row.physicalCondition === '1' ? 'primary' : scope.row.physicalCondition == '2' ? 'success':'danger'"
                disable-transitions>{{scope.row.physicalCondition == '1' ? '正常':scope.row.physicalCondition == '2' ? '良好':'异常' }}</el-tag>
            </template>
          </el-table-column>
        <el-table-column
          label="核酸检测结果"
          align="center"
          prop="nucieicAcidTestResult" width="180px"
          :filters="[{ text: '阴性', value: '1' }, { text: '阳性', value: '0' }]"
          :filter-method="filterTag">
            <template slot-scope="scope">
              <el-tag
                :type="scope.row.nucieicAcidTestResult === '1' ? 'success' : 'danger'"
                disable-transitions>{{scope.row.nucieicAcidTestResult === '1' ? '阴性' :'阳性'}}</el-tag>
            </template>
        </el-table-column>
        <el-table-column label="队伍联系方式" align="center" prop="teamContact" width="180px"/>
        <el-table-column label="领队名称" align="center" prop="leaderName" width="180px"/>
          <el-table-column label="图片" align="center" prop="projectName" width="150px">
            <template slot-scope="scope">
              <div v-if="scope.row.projectName == '1'">
                <img src="https://img1.gtimg.com/ninja/2/2021/12/ninja164000513420751.jpg">
              </div>
              <div v-if="scope.row.projectName == '2'">
                <img src="https://img1.gtimg.com/ninja/2/2021/12/ninja164000514751936.jpg">
              </div>
              <div v-if="scope.row.projectName == '3'">
                <img src="https://img1.gtimg.com/ninja/2/2021/12/ninja164000516743104.jpg">
              </div>
              <div v-if="scope.row.projectName == '4'">
                <img src="	https://img1.gtimg.com/ninja/2/2021/12/ninja164000518095871.jpg">
              </div>
              <div v-if="scope.row.projectName == '5'">
                <img src="https://img1.gtimg.com/ninja/2/2021/12/ninja164000519727177.jpg">
              </div>
              <div v-if="scope.row.projectName == '6'">
                <img src="https://img1.gtimg.com/ninja/2/2021/12/ninja164000521359465.jpg">
              </div>
              <div v-if="scope.row.projectName == '7'">
                <img src="https://img1.gtimg.com/ninja/2/2021/12/ninja164000524375745.jpg">
              </div>
              <div v-if="scope.row.projectName == '8'">
                <img src="https://img1.gtimg.com/ninja/2/2021/12/ninja164000525397039.jpg">
              </div>
              <div v-if="scope.row.projectName == '9'">
                <img src="https://img1.gtimg.com/ninja/2/2021/12/ninja164000526940758.jpg">
              </div>
              <div v-if="scope.row.projectName == '10'">
                <img src="https://img1.gtimg.com/ninja/2/2021/12/ninja164005387040545.jpg">
              </div>
              <div v-if="scope.row.projectName == '11'">
                <img src="https://img1.gtimg.com/ninja/2/2021/12/ninja164000539375411.jpg">
              </div>
              <div v-if="scope.row.projectName == '12'">
                <img src="https://img1.gtimg.com/ninja/2/2021/12/ninja164000532450594.jpg">
              </div>
              <div v-if="scope.row.projectName == '13'">
                <img src="https://img1.gtimg.com/ninja/2/2021/12/ninja164000533948069.jpg">
              </div>
              <div v-if="scope.row.projectName == '14'">
                <img src="https://img1.gtimg.com/ninja/2/2021/12/ninja164000536791173.jpg">
              </div>
              <div v-if="scope.row.projectName == '15'">
                <img src="https://img1.gtimg.com/ninja/2/2021/12/ninja164000537839904.jpg">
              </div>

            </template>
          </el-table-column>
        <el-table-column label="项目名称" align="center" prop="projectName" :formatter="projectNameFormatter" width="180px" >
        </el-table-column>
        <el-table-column label="项目种类" align="center" prop="projectType" width="180px">
          <template slot-scope="scope">
            {{scope.row.projectType == 1 ? '单人赛':scope.row.projectType == 2 ? '双人赛':'团体赛' }}
          </template>
        </el-table-column>
      </el-table>
      </div>
    </div>
</template>

<script>
import { pInformationDetail,} from "@/api/system/pInformation";

export default {
  name: "apliationDetail",
  dicts: ['sys_user_sex'],
  data(){
    return {
      name:this.$route.query.name,
      id:this.$route.query.id,
      queryParams:{},
      pInformationList:[],
      loading:false
    }
  },
  created() {
    this.getList();
  },
  methods: {

    filterTag(value,row){
      return row.nucieicAcidTestResult === value;
    },
    filterTag1(value,row){
      return row.physicalCondition === value;
    },
    // 项目名称
    projectNameFormatter(row,cloumn){
      switch(row.projectName){
        case '1':
          return '短道速滑';
          break;
        case '2':
          return '速度滑冰';
          break;
        case '3':
          return '花样滑冰';
          break;
        case '4':
          return '冰球';
          break;
        case '5':
          return '冰壶';
          break;
        case '6':
          return '雪车';
          break;
        case '7':
          return '钢架雪车';
          break;
        case '8':
          return '雪橇';
          break;
        case '9':
          return '冬季两项';
          break;
        case '10':
          return '高山滑雪';
          break;
        case '11':
          return '自由式滑雪';
          break;
        case '12':
          return '单板滑雪';
          break;
        case '13':
          return '跳台滑雪';
          break;
        case '14':
          return '越野滑雪';
          break;
        case '15':
          return '北欧两项';
          break;
        default:
          return '未知';
      }
    },
    /** 查询报名信息列表 */
    getList() {
      this.loading = true;
      // this.queryParams.createUsername = this.$store.state.user.name
      this.queryParams.name= this.name
      this.queryParams.id= this.id
      debugger
      pInformationDetail(this.queryParams).then(response => {
        this.pInformationList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
  }
}

</script>

<style scoped>

</style>
